import request from '@/utils/request'



export function fetchDocumentList(listQuery) {
  return request({
    url: '/getDocumentInfo',
    method: 'post',
    data: {
      documentName: listQuery.documentName,
      type: listQuery.type,
      author: listQuery.author,
      status: listQuery.status
    },
    params: {
      pageNum: listQuery.page,
      pageSize: listQuery.limit
    }
  })
}




export function createDocument(data) {
  return request({
    url: '/insertDocument',
    method: 'post',
    data
  })
}

export function deletDocument(id) {
  return request({
    url: '/deletDocumentByID/' + id,
    method: 'delete'
  })
}

export function updateDocument(data,token) {
  return request({
    url: '/updateDocumentInfo',
    method: 'post',
    data,
    params:{
      token: token
    }
  })
}
